﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IPfiri
{
    //The Abstract product Class
    abstract class AbstractProduct
    {


    }

    //The Concrete Products

    abstract class Car : AbstractProduct
    {
        private string transmisie;
        private string culoare;

        public void setTransmisie(string t)
        {
            transmisie = t;
        }

        public void setCuloare(string c)
        {
            culoare = c;
        }

        public string getTransmisie()
        {
            return transmisie;

        }

        public string getCuloare()
        {
            return culoare;

        }

        public abstract string getDimensiuni();
        public abstract string getDotari();
        public abstract string getMotorizare(); 
        public virtual void setDimensiuni(string str) { }
        public virtual void setDotari(string str) { }
        public virtual void setMotorizare(string str) { }
    }

    class CoupeCar : Car
    {
        private string dotari;
        private string motorizare;
        private string dimensiuni;

        public override void  setDotari(string d)
        {
            dotari = d;
        }

        public override void  setMotorizare(string m)
        {
            motorizare = m;
        }

        public override void  setDimensiuni(string di)
        {
            dimensiuni = di;
        }
        public override string getDotari()
        {
            return dotari;

        }

        public override string getMotorizare()
        {
            return motorizare;

        }

        public override string getDimensiuni()
        {
            return dimensiuni;

        }
    }

    class MiniCar : Car
    {
        private string dotari;
        private string motorizare;
        private string dimensiuni;

        public override void setDotari(string d)
        {
            dotari = d;
        }

        public override void setMotorizare(string mo)
        {
            motorizare = mo;
        }

        public override void setDimensiuni(string di)
        {
            dimensiuni = di;
        }
        public override string getDotari()
        {
            return dotari;

        }

        public override string getMotorizare()
        {
            return motorizare;

        }

        public override string getDimensiuni()
        {
            return dimensiuni;

        }
    }

    class SedanCar : Car
    {
        private string dotari;
        private string motorizare;
        private string dimensiuni;

        public override   void setDotari(string d)
        {
            dotari = d;
        }

        public  override  void setMotorizare(string mo)
        {
            motorizare = mo;
        }

        public override void setDimensiuni(string di)
        {
            dimensiuni = di;
        }
        public override string getDotari()
        {
            return dotari;

        }

        public override string getMotorizare()
        {
            return motorizare;

        }

        public override string getDimensiuni()
        {
            return dimensiuni;

        }
    }
    //The Abstract factory class
    abstract class AbstractFactory
    {
        public abstract AbstractProduct createProduct();
    }

    //The concrete Factory Classes
    class ConcreteFactory1 : AbstractFactory
    {
        public override AbstractProduct createProduct()
        {
            return new CoupeCar();
        }
    }

    class ConcreteFactory2 : AbstractFactory
    {
        public override AbstractProduct createProduct()
        {
            return new MiniCar();
        }
    }

    class ConcreteFactory3 : AbstractFactory
    {
        public override AbstractProduct createProduct()
        {
            return new SedanCar();
        }
    }
}
